# FastAPI应用主文件
from fastapi import FastAPI
from app.config import settings
from app.routers import items

# 创建FastAPI应用实例
app = FastAPI(
    title=settings.APP_NAME,
    version=settings.APP_VERSION,
    debug=settings.DEBUG
)

# 注册路由
app.include_router(items.router)

# 根路径
@app.get("/", tags=["基础"])
async def root():
    """API根路径，返回基本信息"""
    return {
        "message": "欢迎使用FastAPI",
        "status": "运行中",
        "docs": "/docs"
    }

